{% extends "base.html" %}

{% block css %}
    <style>
        #cen {
            text-align: center;
        }

        a:hover {
            color: red;
        }

        .btn-primary:hover {
            color: red;
        }

        tr:hover {
            background-color: #e7e7e7;
        }
    </style>
{% endblock %}

{% block nav %}
    {% for foo in model_list %}
        <li><a href="{{ foo.url }}"><i class="{{ foo.icon }}"></i>{{ foo.model_name }}</a>
        </li>
    {% endfor %}

{% endblock %}

{% block crumbs %}
    <div class="row">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li class="active">
                    <a class="this-page">签名方式</a>
                </li>
            </ol>

        </div>
    </div>
{% endblock %}

{% block body %}

    <div class="row">
        <div class="col-md-12">
            <div class="panel">
                <div class="panel-heading">
                    <a class="btn btn-primary" id="add_id_PeriodicTask" href="{% url 'base:sign_add' %}"> <i
                            class="fa fa-plus-circle"></i>&nbsp;添加签名 </a>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th id="cen">ID</th>
                            <th id="cen">名称</th>
                            <th id="cen">类型</th>
                            <th id="cen">描述</th>
                            <th id="cen">更新时间</th>
                            <th id="cen">更新用户</th>
                            <th id="cen">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for sign in object_list %}
                            <tr>
                                <td id="cen">{{ sign.sign_id }}</td>
                                <td><a href="{% url 'base:sign_update' %}?sign_id={{ sign.sign_id }}&&page={{ page }}"
                                       class="layui-btn layui-btn-xs" lay-event="edit">{{ sign.sign_name }}</a></td>
                                <td id="cen">{{ sign.sign_type }}</td>
                                <td>{{ sign.description }}</td>
                                <td id="cen">{{ sign.update_time }}</td>
                                <td id="cen">{{ sign.update_user }}</td>
                                <td id="cen">
                                    <a href="{% url 'base:sign_delete' %}?sign_id={{ sign.sign_id }}&&page={{ page }}"
                                       class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                                       onclick="return delete_btn()"><img
                                            src="/static/admin/img/icon-deletelink.svg"/>&nbsp;&nbsp;&nbsp;</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
                {% if is_paginated %}
                    <ul class="pagination">
                        {% if first %}
                            <li class="page"><a href="?page=1">1</a></li>
                        {% endif %}
                        {% if left %}
                            {% if left_has_more %}
                                <li class="page"><a href="javascript:void(0)">...</a></li>
                            {% endif %}
                            {% for i in left %}
                                <li class="page"><a href="?page={{ i }}">{{ i }}</a></li>
                            {% endfor %}
                        {% endif %}
                        <li class="page"><a href="javascript:void(0)" class="active"> {{ page_obj.number }}</a></li>
                        {% if right %}
                            {% for i in right %}
                                <li class="page"><a href="?page={{ i }}">{{ i }}</a></li>
                            {% endfor %}
                            {% if right_has_more %}
                                <li class="page"><a href="javascript:void(0)">...</a></li>
                            {% endif %}
                        {% endif %}
                        {% if last %}
                            <li class="page"><a
                                    href="?page={{ paginator.num_pages }}">{{ paginator.num_pages }}</a>
                            </li>
                        {% endif %}

                    </ul>
                {% endif %}
            </div>

        </div>
    </div>


{% endblock %}

{% block javascript %}
    <script>

        //删除
        function delete_btn() {
            if (window.confirm("你确定要删除吗？")) {
                return true;//确定返回真
            }
            else {
                return false;//取消返回假
            }
        }


    </script>
{% endblock %}